define(["Underscore", "Backbone"], function(_, Backbone) {

	var template = 	"<%= (title == \"\" ? \"\" : \"<header><h1>\" + title + \"</h1></header>\") %>" +
					"<%= (description == \"\" ? \"\" : \"<p>\" + description + \"</p>\" ) %>";

	return Backbone.View.extend({
		tagName: "section",
		className: "intro",

		initialize: function() {
			console.log("IntroView - Initialize");

			this.template = _.template(template);
		},

		render: function() {
			console.log("IntroView - Render");
			var model = this.model;

			if (model.get("display") == true) {
				this.$el.empty().addClass(model.get("background"));
				this.$el.append(this.template({
					title: model.get("title"),
					description: model.get("description")
				}));
			}

			return this;
		}
	});
});